<template>
    <div class="check">
        <dialog-driver-details :driver-detail="driverDetailData"></dialog-driver-details>
    </div>
</template>

<script>
    import DialogDriverDetails from '../../components/dialogModel/DriverDetails.vue';
    export default {
        name: 'user-detail',
        props: {
            params: {
                type: Object,
                default: () => {
                    return {}
                }
            }
        },
        components: {
            DialogDriverDetails
        },
        data() {
            return {
                driverDetailData: {}
            }
        },
        computed: {
            // model: function (value) {
            //     return this.params.model
            // },
            id: function (value) {
                return this.params.id
            }
        },
        created() {
            this.$emit('dialogTitle','司机详情');
            this.getDriverDetail();
        },
        methods: {
            getDriverDetail() {
                this.$http.get('user/driver/' + this.id)
                    .then((response) => {
                        this.driverDetailData = response.data.data;
                    })
                    .catch((error) => {
                        if (error.response.data.msg) {
                            this.$message.error(error.response.data.msg);
                        } else {
                            this.$message.error('请求错误：' + error.response.status);
                        }
                    });

            }
        }
    }
</script>

<style scoped>

</style>
